1. Field of the Invention
This invention relates to methods for generating retrieval information to execute a retrieval for specifying a stored location of a method called according to a method call when an object oriented program is executed (hereinafter called “method retrieval”), and arithmetic processing apparatuses for executing the called method by executing the method retrieval employing the retrieval information generated by the methods.
2. Description of the Related Art
In conventional information processing systems with object oriented programming, properties and methods included in the classes at higher order (super classes) are automatically succeeded by the classes at lower order (subclasses), and the methods are overwritten (“override” is usually used in Java language instead of “overwrite”) in the subclasses if necessary. Program of each method is stored in a predetermined area within a memory, and a predetermined method is called in a class in execution, thereby retrieving the stored location for the method.
For example, in C++ programming, link information by a virtual function is buried into a method call program on compilation, thereby specifying a stored location of the method upon a method call. In Java programming, retrieval employing a hash table hereinafter called (“hashing”) has been proposed (Japanese Laid-open Patent Publications Hei 5-120022 and 8-278894).
In the conventional method for setting link information on compilation, the compilation has to be repeated by resetting the link when the design is changed by changing the class ovewriting the method, thereby extremely deteriorating development efficiency of the system.
According to the hashing, a character string providing method name and message for method call is converted into a hash value, and a hash table is generated associating the hash value and the storage location of the method. Thereby, when setting of overwriting methods is changed, compilation only for the class to be changed is necessary to be repeated and setting the hash table of the class has only to be changed, so that design change of programs may be easily resolved. The hashing, however, requires ensuring a memory area corresponding to a predetermined number of hash values, but a memory area for unused hash values is ensured, resulting in waste of the memory source.
Moreover, the hashing has the risk of collision where the same hash value is assigned to different methods. In order to avoid such collision, according to a separation chain method or open address hashing, unique retrieval keys are respectively set to the hash values in connection, resulting in complication of the data construction and increase of the memory capacity. When retrieval is executed, a character string before conversion to the hash value is compared with an entry content of the hash table to confirm whether or not a correct retrieval key corresponding to the character string is chosen, thereby inviting the problem that the retrieval takes time and the processing capability of the apparatus is extremely deteriorated.